package zy1208.zy5;

import java.lang.reflect.Field;

public class demo {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName("zy1208.zy5.Cat");
        Field name = aClass.getDeclaredField("name");
        name.setAccessible(true);
        Object o = aClass.newInstance();
        name.set(o,"大黄");
        Object o1 = name.get(o);
        System.out.println(o1);
    }
}